#
#
import requests
# from scrapy.selector import Selector
# import pymysql
#
#
# conn = pymysql.connect(host='127.0.0.1', user='root', passwd='123456', db='test', charset='utf8')
# cour = conn.cursor()
#
#
# def crawl_ip():
#     # 爬取西刺的IP代理
#     headers = {
#         'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36'
#     }
#     for i in range(50, 200):
#         re = requests.get('https://www.xicidaili.com/nn/{0}'.format(i), headers=headers)
#         selector = Selector(text=re.text)
#         all_trs = selector.css('#ip_list tr')
#         # 每爬取一页，都要把数据添加到列表内
#         ip_list = []
#         for tr in all_trs[1:]:
#             speed_tr = tr.css('.bar::attr(title)').extract_first()
#             if speed_tr:
#                 speed = float(speed_tr.split('秒')[0])
#             all_text = tr.css('td::text').extract()
#             ip = all_text[0]
#             port = all_text[1]
#             proxy_type = all_text[5]
#             ip_list.append((ip, port, proxy_type, speed))
#
#         # 每爬取一页，存取一次数据到数据库内
#
#         for in_fo in ip_list:
#             insert_sql = """
#                 insert into ip_pool(ip, port, proxy_type, speed)
#                 VALUES(%s, %s, %s, %s) ON DUPLICATE KEY UPDATE speed=VALUES(speed)
#             """
#             ip = in_fo[0]
#             port = in_fo[1]
#             proxy_type = in_fo[2]
#             speed_data = in_fo[3]
#             params = (ip, port, proxy_type, speed_data)
#             cour.execute(insert_sql,params)
#             conn.commit()  # 每存储一条数据要提交一次
#
#
# # crawl_ip()
#
# from selenium import webdriver
# import time
#
#
# browser = webdriver.Chrome()
# browser.get('https://passport.jd.com/new/login.aspx')
# browser.implicitly_wait(10)
# try:
#     browser.find_element_by_xpath("//a[text()='账户登录']").click()
#     browser.find_element_by_css_selector('.item.item-fore1 .itxt').send_keys('15323781898')
#     browser.find_element_by_xpath("//input[@id='nloginpwd']").send_keys('464465fds')
#     browser.find_element_by_xpath("//a[@id='loginsubmit']").click()
# except Exception as e:
#     print(e)
# finally:
#     time.sleep(2)
#     browser.quit()

# a = ['\n                                    1、2年以上开发经验。', '2、熟悉Java语言，OOP概念。', '3、关系数据库和SQL基础。', '4、熟悉Git。', '5、有Java性能调优/故障排除经验者优先。', '6、了解CI/CD和DevOps优先。\n                                ']
# s = ''
# for i in a:
#     s+=i.strip()
# print(s)

login_url = "https://www.zhipin.com/c101020100/y_6/?query=java&page=1"
# login_url = "https://login.zhipin.com/wapi/zppassport/login/account"

data = {
    "pk": "cpc_user_sign_up",
    "regionCode": "%2B86",
    "account": "15102115904",
    "password": "199213xiao",
    "csessionId": '01LtCMwQRh_tvs0Qe6G-8Xl6IbNZdWjVLKXCo7C-FErbmKEAAe3_zNXBpADl8Fa6GR0guSwCyL-M6JiICtRAJzB0Hzrwy86Xy1xTAvWk_gKd6SX7t3uGLCgfqzPNMc8y62Xs-GazCGB_iESBD75QKy5IeZUuyKj6po59B4fHptsYGcAtxux40jPIjq1XJD6NQg',
    "csig": '05XqrtZ0EaFgmmqIQes-s-CC8Rii3iO-isqdlCc_VTpiryaqSJ1PIqgi-2XFuBQX2Dlt56sJW1J7-7bo5rUUf-kUF3yTbzUYoW2E56H1VXc-LBg_ynsy-9oG96x1z-X4QRENQQ-avIkvI2P0O2q_39kIxsc4KANuNMJi0_STERPKCXprI2yMaOEuInU0GSoZNQrKJnAtNF3N2we10Tb9NbwJNq9P582T6rLSW8v3wFF7716Xu-Ez9alLOIp-sEDTZkO4w1Ue28cRCZKHCAwoL9ocNkLirw8Ct_P9mHrfgZJA7rQHwRn4IT6XDIjkIHB-wH76s901ZUXvYDtOBG-fI48P5Q68AV3ox4lvrpjG321IUj3zey-9SZ6MInwGXAx7AS0DJBhE4R0n0WSJMqDSJELVubFCgTKtmLuE7L-GmrwumZaykPHIAQSjiRuyvIEpv1',
    "ctoken": "BOSS_PC%3A1593261152611%3A0.3b8269cc86019",
    "cscene": "nc_login",
    "cappKey": "FFFF0N00000000006DC1"
}
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36',
    'cookie':'lastCity=101020100; _uab_collina=158806552099978458548422; __c=1593249664; __g=sem; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1591577266,1591588570,1591588698,1593249664; __l=l=%2Fwww.zhipin.com%2Fsem%2F10.html%3Fsid%3Dsem%26qudao%3Dbdpc_baidu-pc-BOSS-JD02-B19KA02084%26plan%3D%25E8%25A1%258C%25E4%25B8%259A%25E5%25AE%259A%25E6%258A%2595-%25E7%25AB%259E%25E5%2593%2581%26unit%3D%25E6%2599%25BA%25E8%2581%2594-2%26keyword%3Dwww.hugoboss.cn%26bd_vid%3D10603418226142070815%26csource%3Dboctb&r=https%3A%2F%2Fwww.baidu.com%2Fbaidu.php%3Fsc.a00000KEJeCxDFezE-oKym3FLnNdOd43meaMXztriSZUMtUjBWppV_JzrkQuODzxiWaLIK_8ADXB9yTbbZ_Jy5leBXrPRgYXd1c_zvRq0JxQsgob7sDIzAusQFy0WkHTQVpzhvkzk0RUc7C_8FeFNQ0jPYc0RbuJ3-J7_LCZ3rm1D_GsjosoIpfgNxYGYpADW7TYuMvbfqFK2yFlc8quhCrkFbIe.7b_NR2Ar5Od663rj6t8AGSPticrZA1AlaqM766WHGek3hcYlXE_sgn8mE8kstVerQKMks4OgSWS534Oqo4yunOogEOtZV_zyUr1oWC_knmx5u9qVXZutrZ1en5o_seOU9tqvZvSXZxeT5MY3IMVseqvxj4SrZvS8Zx43x5I9LtTrzEo6BxfmsSxH9Let5oeT5M_se2trO_14rEpMwsrh8m3rj6tJ_AGdeC3SHojAeKPa-BqYPaOonh4tzmpj7Na9WWOqmcrj635Q9JxWxDBaPrha81h_HAlzzzz1Fgzdn84TXGmuCyrrOkolN0.U1Yk0ZDqmhq1TsKspynqn0KY5yFETLn0pyYqnWcd0ATqTZnz0ZNG5yF9pywd0ZKGujYz0APGujYYnjR0UgfqnH0krNtknjDLg1DsnWPxnH0YP7t1PW0k0AVG5H00TMfqrjck0ANGujY0mhbqnHR3g1csP7tznHT0UynqnH0snNtkrjRYrjT1rj6Yg17xnH0zg100TgKGujYs0Z7Wpyfqn0KzuLw9u1Ys0A7B5HKxn0K-ThTqn0KsTjY3nj0LP1DkPj00UMus5H08nj0snj0snj00Ugws5H00uAwETjYs0ZFJ5H00uANv5gKW0AuY5H00TA6qn0KET1Ys0AFL5HDs0A4Y5H00TLCq0A71gv-bm1dsTzd-mvC0pywW5R42i-n0IA7zuvNY5Hm1g1Kxn10s0ZwdT1YvP1RYP1mknW61P1bvPHT1PWbk0ZF-TgfqnHR4n1cYrHmdPWT3PfK1pyfqm1uWP1-brAmsnj0km1mdu6KWTvYqPRD4P1nzfHwKfWFAwWwKf6K9m1Yk0ZwdIjYk0ZK85H00TydY5H00Tyd15H00uANYgvPsmHYs0ZGY5H00UyPxuMFEUHYsg1Kxn7tknjfvg100uA78IyF-gLK_my4GuZnqn7tsg1KxPjnknjb4PNts0ZK9I7qhUA7M5H00uAPGujYs0ANYpyfqQHD0mgPsmvnqn0KdTA-8mvnqn0KkUymqn0KhmLNY5H00pgPWUjYs0ZGsUZN15H00mywhUA7M5H60UAuW5H00uAPWujY0IZF9uARqP1msnW0z0AFbpyfqnWuawWKAPH6knRRsPjTswDwDn1n4PWmLwW9KPRD4nj00UvnqnfKBIjYs0Aq9IZTqn0KEIjYk0AqzTZfqnBnsc1Dsc1cWrHc3nHf3PWmWn1msnj0Wn1msnj08nj0snj0sc1DWnBnsczYWna3snj0snj0Wni3snj0snj00TNqv5H08rjwxna3sn7tsQW0sg108P1uxna3LP-tsQWnz0AF1gLKzUvwGujYs0APzm1YYnj6v%26ck%3D8408.1.82.350.184.344.188.501%26shh%3Dwww.baidu.com%26sht%3D50000021_hao_pg%26us%3D1.0.1.0.1.314.0%26ie%3Dutf-8%26f%3D8%26srcqid%3D4327514438385593050%26tn%3D50000021_hao_pg%26wd%3Dboss%26oq%3Dbosss%26rqlang%3Dcn%26inputT%3D199%26bc%3D110101&g=%2Fwww.zhipin.com%2Fsem%2F10.html%3Fsid%3Dsem%26qudao%3Dbdpc_baidu-pc-BOSS-JD02-B19KA02084%26plan%3D%25E8%25A1%258C%25E4%25B8%259A%25E5%25AE%259A%25E6%258A%2595-%25E7%25AB%259E%25E5%2593%2581%26unit%3D%25E6%2599%25BA%25E8%2581%2594-2%26keyword%3Dwww.hugoboss.cn%26bd_vid%3D10603418226142070815%26csource%3Dboctb&friend_source=0&friend_source=0; JSESSIONID=""; __zp__pub__=; __zp_stoken__=8ed5afGgwYz95QVhQbTRNNBMuWgRrdjwtK0MOJSd6Uz0VNwJ%2FRkhQBRoDAjluNXUSWnsJZGtdRzp%2BEwgVaEJ%2BFCtzWDh6Zh4LVRkjdFQ9DF0uHC43U0ZQOQYYYDNnNzBNGEJMGzhbRT82Vg0%3D; toUrl=/; __a=8132305.1588065488.1591576893.1593249664.114.7.56.56; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1593263083'
}
# session = requests.Session()
response = requests.get(login_url, headers=headers)
print(response.content.decode('utf-8'))
























